package com.test.burnincash.bean_burnin.user_info_burnin;

import com.test.burnincash.util_burnin.StringUtil_burnin;
import com.google.gson.Gson;

import org.json.JSONObject;

/**
 * 用户登录信息，只在用户手动登录时获取，自动登录不获取
 */
public class LoginInfo_burnin {

    private static class Inner {
        private static LoginInfo_burnin instance = new LoginInfo_burnin();
    }

    private LoginInfo_burnin(){}

    public static LoginInfo_burnin getInstance(){
        return Inner.instance;
    }

    private String type,token,userId, isAdSource;

    public static void parse(JSONObject objJson){
        Inner.instance = new Gson().fromJson(objJson.toString(), LoginInfo_burnin.class);
    }

    public String getToken() {
        return StringUtil_burnin.getSafeString(token);
    }

    public String getUserId() {
        return StringUtil_burnin.getSafeString(userId);
    }

    public String getType() {
        return StringUtil_burnin.getSafeString(type);
    }

    public String getIsAdSource() {
        return StringUtil_burnin.getSafeString(isAdSource);
    }

}
